﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace myAlarm
{
    public partial class Alarm : Form
    {
        public Alarm()
        {
            InitializeComponent();
        }

        public Alarm(string title, string content, string time, bool repeat)
        {
            this.Text = title;
            this.lblMsg.Text = string.Format("{0} 时间到了……", time);
            this.rtbContent.Text = content;
            this.btnReAlarm.Enabled = repeat;
        }

        private void btnKnow_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnReset_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnReAlarm_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Retry;
            this.Close();
        }
    }
}
